/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cardgame.game.monsters;

import cardgame.game.*;
import cardgame.game.events.*;
import cardgame.game.filters.*;

/**
 *
 * @author Carl
 */
public class Soraka extends MonsterCard{

    public Soraka(){
        description = new Description("Soraka", "-> Free Mana");
        manaTypes = new Mana[]{Mana.CUSTOM};
        summonCost = new Cost(new ManaAmount(Mana.CUSTOM, 1), 0, false);
        attackDamage = 0;
        setLifepoints(1);
        setSpells(new Spell[]{new Spell(){{
                description = new Description("Charge Mana");
                cost = new Cost(new ManaAmount(Mana.CUSTOM, 2), 0, true);
            }

            @Override
            public void cast(Game game, SpellParameter[] parameters){
                SimpleManaCard manaCard = (SimpleManaCard) caster.getOwner().getDeck().getRandom(new ClassCardFilter(SimpleManaCard.class));
                if(manaCard != null){
                    if(game.triggerEvent(new AddDeckManaEvent(caster.getOwner(), manaCard))){
                        if(game.triggerEvent(new TapEvent(manaCard))){
                            caster.getOwner().getManaPool().update();
                        }
                    }
                }
            }
        }});
    }
}
